home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / nntpcmac.h < prev    next >
C/C++ Source or Header  |  1994-09-14  |  6KB  |  137 lines

  1. /*
  2.  * Program:    Network News Transfer Protocol (NNTP) client routines for Mac
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    12 December 1993
  13.  * Last Edited:    14 September 1994
  14.  *
  15.  * Copyright 1994 by Mark Crispin
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notices and this permission notice appear in supporting
  21.  * documentation, and that the name of Mark Crispin not be used in advertising
  22.  * or publicity pertaining to distribution of the software without specific,
  23.  * written prior permission.  This software is made available "as is", and
  24.  * MARK CRISPIN DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO
  25.  * THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF
  26.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL
  27.  * MARK CRISPIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
  28.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  29.  * WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT
  30.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  31.  * THIS SOFTWARE.
  32.  *
  33.  */
  34.  
  35. /* Constants */
  36.  
  37. #define NNTPGOK (long) 211    /* NNTP group selection OK */
  38. #define NNTPGLIST (long) 215    /* NNTP group list being returned */
  39. #define NNTPHEAD (long) 221    /* NNTP header text */
  40. #define NNTPBODY (long) 222    /* NNTP body text */
  41.  
  42.  
  43. /* Command bits from nntp_getflags() */
  44.  
  45. #define fSEEN 1
  46. #define fDELETED 2
  47. #define fFLAGGED 4
  48. #define fANSWERED 8
  49.  
  50.  
  51. /* NNTP I/O stream local data */
  52.     
  53. typedef struct nntp_local {
  54.   SMTPSTREAM *nntpstream;    /* NNTP stream for I/O */
  55.   unsigned int dirty : 1;    /* disk copy of .newsrc needs updating */
  56.   char *host;            /* local host name */
  57.   char *name;            /* local bboard name */
  58.   char *buf;            /* temporary buffer */
  59.   unsigned long buflen;        /* current size of temporary buffer */
  60.   unsigned long *number;    /* news message numbers */
  61.   char **header;        /* message headers */
  62.   char **body;            /* message bodies */
  63. } NNTPLOCAL;
  64.  
  65.  
  66. /* Convenient access to local data */
  67.  
  68. #define LOCAL ((NNTPLOCAL *) stream->local)
  69.  
  70. /* Function prototypes */
  71.  
  72. DRIVER *nntp_valid (char *name);
  73. void *nntp_parameters (long function,void *value);
  74. void nntp_find (MAILSTREAM *stream,char *pat);
  75. void nntp_find_bboards (MAILSTREAM *stream,char *pat);
  76. void nntp_find_all (MAILSTREAM *stream,char *pat);
  77. void nntp_find_all_bboards (MAILSTREAM *stream,char *pat);
  78. long nntp_subscribe (MAILSTREAM *stream,char *mailbox);
  79. long nntp_unsubscribe (MAILSTREAM *stream,char *mailbox);
  80. long nntp_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  81. long nntp_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  82. long nntp_create (MAILSTREAM *stream,char *mailbox);
  83. long nntp_delete (MAILSTREAM *stream,char *mailbox);
  84. long nntp_rename (MAILSTREAM *stream,char *old,char *new);
  85. MAILSTREAM *nntp_mopen (MAILSTREAM *stream);
  86. void nntp_close (MAILSTREAM *stream);
  87. void nntp_fetchfast (MAILSTREAM *stream,char *sequence);
  88. void nntp_fetchflags (MAILSTREAM *stream,char *sequence);
  89. ENVELOPE *nntp_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  90. char *nntp_fetchheader (MAILSTREAM *stream,long msgno);
  91. char *nntp_fetchtext (MAILSTREAM *stream,long msgno);
  92. char *nntp_fetchtext_work (MAILSTREAM *stream,long msgno);
  93. char *nntp_fetchbody (MAILSTREAM *stream,long m,char *s,unsigned long *len);
  94. char *nntp_slurp (MAILSTREAM *stream);
  95. void nntp_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  96. void nntp_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  97. void nntp_search (MAILSTREAM *stream,char *criteria);
  98. long nntp_ping (MAILSTREAM *stream);
  99. void nntp_check (MAILSTREAM *stream);
  100. void nntp_expunge (MAILSTREAM *stream);
  101. long nntp_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  102. long nntp_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  103. long nntp_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  104.           STRING *message);
  105. void nntp_gc (MAILSTREAM *stream,long gcflags);
  106.  
  107. short nntp_getflags (MAILSTREAM *stream,char *flag);
  108. char nntp_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  109. char nntp_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  110. char nntp_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  111. char nntp_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  112. char nntp_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  113. char nntp_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  114. char nntp_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  115. char nntp_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  116. char nntp_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  117. char nntp_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  118. char nntp_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  119. char nntp_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  120. char nntp_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char nntp_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char nntp_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char nntp_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  124. char nntp_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  125. unsigned long nntp_msgdate (MAILSTREAM *stream,long msgno);
  126. char nntp_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  127. char nntp_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char nntp_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char nntp_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char nntp_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char nntp_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char nntp_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  133. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  134. search_t nntp_search_date (search_t f,long *n);
  135. search_t nntp_search_flag (search_t f,char **d);
  136. search_t nntp_search_string (search_t f,char **d,long *n);
  137.